|
enocean5 2.2.0
|
API for configuring and manipulating EnOcean 5 Click driver. More...
Topics | |
| EnOcean 5 Device Settings | |
| Settings of EnOcean 5 Click driver. | |
| EnOcean 5 MikroBUS Map | |
| MikroBUS pin mapping of EnOcean 5 Click driver. | |
Functions | |
| void | enocean5_cfg_setup (enocean5_cfg_t *cfg) |
| EnOcean 5 configuration object setup function. | |
| err_t | enocean5_init (enocean5_t *ctx, enocean5_cfg_t *cfg) |
| EnOcean 5 initialization function. | |
| err_t | enocean5_generic_write (enocean5_t *ctx, uint8_t *data_in, uint16_t len) |
| EnOcean 5 data writing function. | |
| err_t | enocean5_generic_read (enocean5_t *ctx, uint8_t *data_out, uint16_t len) |
| EnOcean 5 data reading function. | |
| void | enocean5_set_rst_pin (enocean5_t *ctx, uint8_t state) |
| EnOcean 5 set RST pin function. | |
| err_t | enocean5_reset_device (enocean5_t *ctx) |
| EnOcean 5 reset device function. | |
| err_t | enocean5_send_packet (enocean5_t *ctx) |
| EnOcean 5 send packet function. | |
| err_t | enocean5_read_packet (enocean5_t *ctx) |
| EnOcean 5 read packet function. | |
| err_t | enocean5_wait_packet (enocean5_t *ctx, uint8_t type, uint8_t cmd, uint8_t max_time_s) |
| EnOcean 5 wait packet function. | |
| void | enocean5_clear_buffers (enocean5_t *ctx) |
| EnOcean 5 clear buffers function. | |
| err_t | enocean5_read_info (enocean5_t *ctx) |
| EnOcean 5 read info function. | |
| err_t | enocean5_send_radio_message (enocean5_t *ctx, uint8_t rorg, uint8_t *data_in, uint8_t data_len) |
| EnOcean 5 send radio message function. | |
API for configuring and manipulating EnOcean 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void enocean5_cfg_setup | ( | enocean5_cfg_t * | cfg | ) |
EnOcean 5 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See enocean5_cfg_t object definition for detailed explanation. |
| void enocean5_clear_buffers | ( | enocean5_t * | ctx | ) |
EnOcean 5 clear buffers function.
This function clears the ring buffers and the RX packet object.
| [in] | ctx | : Click context object. See enocean5_t object definition for detailed explanation. |
| err_t enocean5_generic_read | ( | enocean5_t * | ctx, |
| uint8_t * | data_out, | ||
| uint16_t | len ) |
EnOcean 5 data reading function.
This function reads a desired number of data bytes by using UART serial interface.
| [in] | ctx | : Click context object. See enocean5_t object definition for detailed explanation. |
| [out] | data_out | : Output read data. |
| [in] | len | : Number of bytes to be read. |
>0 - Number of data bytes read, <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation. | err_t enocean5_generic_write | ( | enocean5_t * | ctx, |
| uint8_t * | data_in, | ||
| uint16_t | len ) |
EnOcean 5 data writing function.
This function writes a desired number of data bytes by using UART serial interface.
| [in] | ctx | : Click context object. See enocean5_t object definition for detailed explanation. |
| [in] | data_in | : Data buffer for sending. |
| [in] | len | : Number of bytes for sending. |
>=0 - Success, <0 - Error. See #err_t definition for detailed explanation. | err_t enocean5_init | ( | enocean5_t * | ctx, |
| enocean5_cfg_t * | cfg ) |
EnOcean 5 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See enocean5_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See enocean5_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t enocean5_read_info | ( | enocean5_t * | ctx | ) |
EnOcean 5 read info function.
This function reads the device information and stores it in the Click context object.
| [in] | ctx | : Click context object. See enocean5_t object definition for detailed explanation. |
0 - Correct packet received, -1 - Error, >0 - Response error, see ENOCEAN5_RET_x macros. See #err_t definition for detailed explanation. | err_t enocean5_read_packet | ( | enocean5_t * | ctx | ) |
EnOcean 5 read packet function.
This function reads RX packet from the ring buffer and stores it in the Click context object. It waits up to 1 second for a packet, and if there's no packet received it returns an error.
| [in] | ctx | : Click context object. See enocean5_t object definition for detailed explanation. |
0 - Correct packet received, -1 - Error. See #err_t definition for detailed explanation. | err_t enocean5_reset_device | ( | enocean5_t * | ctx | ) |
EnOcean 5 reset device function.
This function resets the device by toggling the reset pin logic state.
| [in] | ctx | : Click context object. See enocean5_t object definition for detailed explanation. |
0 - Correct packet received, -1 - Error. | err_t enocean5_send_packet | ( | enocean5_t * | ctx | ) |
EnOcean 5 send packet function.
This function sends TX packet from the Click context object.
| [in] | ctx | : Click context object. See enocean5_t object definition for detailed explanation. |
0 - Packet is sent, -1 - Packet error. | err_t enocean5_send_radio_message | ( | enocean5_t * | ctx, |
| uint8_t | rorg, | ||
| uint8_t * | data_in, | ||
| uint8_t | data_len ) |
EnOcean 5 send radio message function.
This function forms and sends the radio message telegram.
| [in] | ctx | : Click context object. See enocean5_t object definition for detailed explanation. |
| [in] | rorg | : Telegram type. |
| [in] | data_in | : Data content. |
| [in] | data_len | : Number of data bytes (up to 14). |
0 - Packet is sent, -1 - Packet error. See #err_t definition for detailed explanation. | void enocean5_set_rst_pin | ( | enocean5_t * | ctx, |
| uint8_t | state ) |
EnOcean 5 set RST pin function.
This function sets the RESET pin logic state.
| [in] | ctx | : Click context object. See enocean5_t object definition for detailed explanation. |
| [in] | state | : Pin logic state. |
| err_t enocean5_wait_packet | ( | enocean5_t * | ctx, |
| uint8_t | type, | ||
| uint8_t | cmd, | ||
| uint8_t | max_time_s ) |
EnOcean 5 wait packet function.
This function waits for the desired RX packet to arrive and stores it in the Click context object.
| [in] | ctx | : Click context object. See enocean5_t object definition for detailed explanation. |
| [in] | type | : Expected packet type byte. |
| [in] | cmd | : Expected packet code byte. |
| [in] | max_time_s | : Maximum wait time in seconds. |
0 - Correct packet received, -1 - Error, >0 - Response error, see ENOCEAN5_RET_x macros.